﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FanPages.Common;
using FanPages.Server.Services.Contracts.Dto;
using FanPages.Model;

namespace FanPages.Client.Core.Transformers
{
    public class ConfigurationTransformer : ITransformer<Configuration,ConfigurationDto>
    {
        public ConfigurationDto ToDto(Configuration entity)
        {
            return new ConfigurationDto()
            {
                Id = entity.Id,
                SearchWords = entity.SearchWords,
                FrequencyPerDay = entity.FrequencyPerDay,
                FanItem = new FanItemTransformer().ToDto(entity.FanItem)
            };
        }

        public Configuration ToClient(ConfigurationDto dto)
        {
            var entity = new Configuration()
            {
                Id = dto.Id,
                SearchWords = dto.SearchWords,
                FrequencyPerDay = dto.FrequencyPerDay,
                FanItem = new FanItemTransformer().ToClient(dto.FanItem)
            };            
            return entity;
        }

        public List<ConfigurationDto> ToListDto(List<Configuration> list)
        {
            throw new NotImplementedException();
        }

        public List<Configuration> ToListEntity(List<ConfigurationDto> list)
        {
            throw new NotImplementedException();
        }
    }
}
